package cn.wizzer.app.web.commons.ext.websocket.main.result;

import cn.wizzer.framework.util.Result;
import lombok.Data;

/**
 * 聊天接口响应结果
 */
@Data
public class ChatResult extends Result {

    private String action;

    private String type;

    private String content;

    public ChatResult(String action, String type,String content) {
        this.action = action;
        this.type = type;
        this.content = content;
    }

    public enum MessageTypeEnum {
        SYSTEM("sys"),// 群聊？
        USER("user"), // 用户发言
        ATTENDANT("attendant"), // 客服
        ACTION("action"); // 事件
        public final String NAME;

        MessageTypeEnum(String name) {
            NAME = name;
        }
    }

    public enum ActionEnum {
        LEAVE("leave"),
        JOIN("join"),
        READ("read"),
        SEND("send"),
        REMAND("remand"),
        DISABLE("disable"),
        ENABLE("enable"),
        LOGIN_SUCCESS("login_success"),
        LOGIN_ERROR("login_error"),
        SUCCESS("success"),
        ERROR("error")
        ;
        public final String NAME;

        ActionEnum(String name) {
            NAME = name;
        }
    }

}
